package code.structure.module.configs.cmd
{
	import code.structure.module.configs.data.LevelConfigData;
	
	import flash.utils.Dictionary;

	public class AnalysisLevel
	{
		/**
		 * 物品字典 
		 */
		private var _levelDataDic:Dictionary;
		public function AnalysisLevel()
		{
		}
		
		/**
		 *解析 
		 * @param itemData
		 * @param productData
		 * 
		 */
		public function parserData(levelData:Object):void{
			_levelDataDic = new Dictionary();
			var d:LevelConfigData; 
			for each(var o:Object in levelData){
				d = new LevelConfigData(o);
				_levelDataDic[d.id] = d;
			}
		}
		
		/**
		 * 通过物品id获取配置数据 
		 * @param id
		 * @return 
		 * 
		 */
		public function getlevelConfigDataById(id:int):LevelConfigData{
			return _levelDataDic[id] as LevelConfigData;
		}
	}
}